﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoU.Client.Service;
using LoU.Client.DataContract;
using Lou.Client.Service.Authentication;
using System.IO;
using System.Security;

namespace LoU.Client.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            AuthenticationTest();
        }

        static void AuthenticationTest()
        {

            Dictionary<string, World> worlds = Game.Getworlds(Console.ReadLine(), getPassword().ToString());
            World world43 = worlds[worlds.Keys.Where(a => a.Contains("43")).First()];
            WorldConnector connectorW43 = new WorldConnector(world43);

            ReportHeader[] rh = connectorW43.ReportGetHeader(0, 36503943, 200703, 0, 99, 0, false);
        }

        static string getPassword()
        {
            StringBuilder pwd = new StringBuilder();
            while (true)
            {
                ConsoleKeyInfo i = Console.ReadKey(true);
                if (i.Key == ConsoleKey.Enter)
                {
                    break;
                }
                else if (i.Key == ConsoleKey.Backspace)
                {
                    pwd.Remove(pwd.Length - 1, 1);
                    Console.Write("\b \b");
                }
                else
                {
                    pwd.Append(i.KeyChar);
                    Console.Write("*");
                }
            }
            return pwd.ToString();
        }
    }
}
